<template>
	<view>
		<view style="height: 20upx;"></view>
		<view v-if="reportTerms.length == 0">
			<image src="../../static/nodata.png" class="style1"></image>
			<view class="style2">暂无学期报告</view>
		</view>
		<view v-else v-for="(item,index) in reportTerms" >
			<view class="style4">{{item.termName}}</view>
			<!-- <uni-icons type="arrowright" color="rgb(179,179,179)" size="22" class="style5"/> -->
			<view @tap="toNext(index)" class="style6">查看报告</view>
			<view class="style3" ></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				reportTerms:[],//学期报告
			}
		},
		onLoad() {
			this.generateTermReport();
			this.getTermId();
		},
		onShow() {
			
		},
		created() {

		},
		methods: {
			//跳转到学期报告详情
			toNext(index){
				let that = this;
				uni.navigateTo({
					url:'/pages/my/reportDetail?termName='+that.reportTerms[index].termName,
				})
			},
			//生成学期报告
			generateTermReport(){
				let that = this;
				that.pyReq(that.$http.generateTermReport,{},function(){
					
				})
			},
			//获取学期报告列表
			getTermId(){
				let that = this;
				that.pyReq(that.$http.getTermId,{},function(res){
					that.reportTerms = res.result;
					console.log(that.reportTerms);
				});
			}
		}
	}
</script>

<style>
	.style1{
		width: 380upx;
		height: 400upx;
		margin: 300upx 0 0 175upx;
	}
	.style2{
		font-size: 30upx;
		text-align: center;
		color: #c6c6c6;
	}
	.style3{
		width: 700upx;
		margin: 0upx 25upx 0 25upx;
		height: 1upx;
		background-color: #999999;
		float: left;
	}
	.style4{
		margin: 20upx 0 20upx 30upx;
		float: left;
	}
	.style5{
		float: right;
		margin-right: 30upx;
		margin-top: 20upx;
	}
	.style6{
		color: #B31610;
		border: 1px solid #B31610;
		border-radius: 18px;
		width: 177upx;
		height: 36upx;
		line-height: 1;
		float: right;
		text-align: center;
		line-height: 36upx;
		margin-right: 50upx;
		margin-top: 24upx;
	}
</style>
